package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaConsumableMapper;
import com.yiyahui.project.erp.domain.YiyaConsumable;
import com.yiyahui.project.erp.service.IYiyaConsumableService;

/**
 * 耗材管理Service业务层处理
 * 
 * @author yiyahui
 * @date 2020-05-12
 */
@Service
public class YiyaConsumableServiceImpl implements IYiyaConsumableService 
{
    @Autowired
    private YiyaConsumableMapper yiyaConsumableMapper;

    /**
     * 查询耗材管理
     * 
     * @param id 耗材管理ID
     * @return 耗材管理
     */
    @Override
    public YiyaConsumable selectYiyaConsumableById(Long id)
    {
        return yiyaConsumableMapper.selectYiyaConsumableById(id);
    }

    /**
     * 查询耗材管理列表
     * 
     * @param yiyaConsumable 耗材管理
     * @return 耗材管理
     */
    @Override
    public List<YiyaConsumable> selectYiyaConsumableList(YiyaConsumable yiyaConsumable)
    {
        return yiyaConsumableMapper.selectYiyaConsumableList(yiyaConsumable);
    }

    /**
     * 新增耗材管理
     * 
     * @param yiyaConsumable 耗材管理
     * @return 结果
     */
    @Override
    public int insertYiyaConsumable(YiyaConsumable yiyaConsumable)
    {
        yiyaConsumable.setCreateTime(DateUtils.getNowDate());
        return yiyaConsumableMapper.insertYiyaConsumable(yiyaConsumable);
    }

    /**
     * 修改耗材管理
     * 
     * @param yiyaConsumable 耗材管理
     * @return 结果
     */
    @Override
    public int updateYiyaConsumable(YiyaConsumable yiyaConsumable)
    {
        yiyaConsumable.setUpdateTime(DateUtils.getNowDate());
        return yiyaConsumableMapper.updateYiyaConsumable(yiyaConsumable);
    }

    /**
     * 批量删除耗材管理
     * 
     * @param ids 需要删除的耗材管理ID
     * @return 结果
     */
    @Override
    public int deleteYiyaConsumableByIds(Long[] ids)
    {
        return yiyaConsumableMapper.deleteYiyaConsumableByIds(ids);
    }

    /**
     * 删除耗材管理信息
     * 
     * @param id 耗材管理ID
     * @return 结果
     */
    @Override
    public int deleteYiyaConsumableById(Long id)
    {
        return yiyaConsumableMapper.deleteYiyaConsumableById(id);
    }
}
